<?php


namespace app\api\controller\v1;


use app\api\controller\BaseController;
use app\api\service\DistributeConfig;
use app\api\service\Token;
use app\lib\exception\DistributeConfigException;

class Distribute extends BaseController
{
    /**
     * 添加分销配置信息
     * @return \app\api\model\DistributConfig
     * @throws DistributeConfigException
     */
        public function insertData(){
            $data = input('post.');
            $t_id = Token::getCurrentUid();
            $config = new DistributeConfig();
            $result =  $config->addData($data,$t_id);
            if (!$result){
                throw  new DistributeConfigException();
            }
            return $result;
        }
}